/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.test.bean;

import java.io.Serializable;

/**
 * 
 * @author Anjali
 */
public class Student implements Serializable {

	private String firstName;
	private String lastName;
	private int studentId;
	
	private String password;
	 
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	 
	
	

	public int getStudentId() {
		return studentId;
	}

	public void setStudentId(int studentId) {
		this.studentId = studentId;
	}

	@Override
	public int hashCode() {

		return Integer.valueOf(studentId).hashCode() + firstName.hashCode()
				+ lastName.hashCode();
	}

	@Override
	public boolean equals(Object obj) {

		if (obj != null) {

			if (obj instanceof Student) {
				Student student = (Student) obj;
				if (this.studentId == student.getStudentId()
						&& this.firstName.equalsIgnoreCase(student
								.getFirstName())
						&& this.lastName
								.equalsIgnoreCase(student.getLastName())) {
					return true;
				}
			}

		}

		return false;
	}
}
